<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>上传测试</title>
    <meta name="context-path" th:content="@{/}"/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
    <link rel="stylesheet" th:href="@{/resources/uploader/Jquery_Uploader/css/jquery.fileupload.css}">
    <link rel="stylesheet" th:href="@{/resources/uploader/Jquery_Uploader/css/jquery.fileupload-ui.css}">
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css">
    <style>
        /* input样式 */
        #uploadImg {
            display: none;
        }

        /* button样式 */
        #chooseFile {
            background: #93b6fc;
        }

        #uploadFile, #rechooseFile {
            display: none;
            background: #93b6fc;
        }

        #image {
            width: 200px;
            height: 200px;
        }

        /* 进度条样式 */
        .bar {
            background-image: -webkit-linear-gradient(top, #5cb85c 0, #449d44 100%);
            background-image: -o-linear-gradient(top, #5cb85c 0, #449d44 100%);
            background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
            background-image: linear-gradient(to bottom, #5cb85c 0, #449d44 100%);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
            background-repeat: repeat-x;
            height: 20px;
            line-height: 20px;
            -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
            box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
            -webkit-transition: width .6s ease;
            -o-transition: width .6s ease;
            transition: width .6s ease;
        }

        #progress {
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
            background-repeat: repeat-x;
            height: 20px;
            width: 0%;
            margin-bottom: 20px;
            overflow: hidden;
            background-color: #f5f5f5;
            border-radius: 4px;
            -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
            margin-top: 20px;
        }
    </style>
</head>
<body class="childbody">
<form id="fileupload" action="https://jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
    <!-- Redirect browsers with JavaScript disabled to the origin page -->
    <noscript><input type="hidden" name="redirect" value="https://blueimp.github.io/jQuery-File-Upload/"></noscript>
    <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
    <div class="row fileupload-buttonbar">
        <div class="col-lg-7">
            <!-- The fileinput-button span is used to style the file input field as button -->
            <span class="btn btn-success fileinput-button">
                    <i class="glyphicon glyphicon-plus"></i>
                    <span>Add files...</span>
                    <input type="file" name="files[]" multiple>
                </span>
            <button type="submit" class="btn btn-primary start">
                <i class="glyphicon glyphicon-upload"></i>
                <span>Start upload</span>
            </button>
            <button type="reset" class="btn btn-warning cancel">
                <i class="glyphicon glyphicon-ban-circle"></i>
                <span>Cancel upload</span>
            </button>
            <button type="button" class="btn btn-danger delete">
                <i class="glyphicon glyphicon-trash"></i>
                <span>Delete</span>
            </button>
            <input type="checkbox" class="toggle">
            <!-- The global file processing state -->
            <span class="fileupload-process"></span>
        </div>
        <!-- The global progress state -->
        <div class="col-lg-5 fileupload-progress fade">
            <!-- The global progress bar -->
            <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                <div class="progress-bar progress-bar-success" style="width:0%;"></div>
            </div>
            <!-- The extended global progress state -->
            <div class="progress-extended">&nbsp;</div>
        </div>
    </div>
    <!-- The table listing the files available for upload/download -->
    <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
</form>
<br>
<br>
<!-- The global progress bar -->
<div id="progress" class="progress">
    <div class="progress-bar progress-bar-success"></div>
</div>
<!-- The container for the uploaded files -->
<div id="files" class="files"></div>
<br>

<script th:src="@{/resources/js/jquery.min.js}"></script>
<script th:src="@{/resources/js/jquery-migrate-1.2.1.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/vendor/load-image.all.min.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/vendor/canvas-to-blob.min.js}"></script>
<script th:src="@{/resources/matrix/js/bootstrap.min.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/vendor/jquery.ui.widget.js}"></script>
<script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
<script src="https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.iframe-transport.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.fileupload.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.fileupload-process.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.fileupload-image.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.fileupload-audio.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.fileupload-video.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.fileupload-validate.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/jquery.fileupload-ui.js}"></script>
<script th:src="@{/resources/uploader/Jquery_Uploader/js/main.js}"></script>
<script>
    /*jslint unparam: true, regexp: true */
    /*global window, $ */
    var contextRoot = $("meta[name='context-path']").attr("content");
</script>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
    /*<![CDATA[*/
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td>
            <span class="preview"></span>
        </td>
        <td>
            <p class="name">{%=file.name%}</p>
            <strong class="error text-danger"></strong>
        </td>
        <td>
            <p class="size">Processing...</p>
            <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
        </td>
        <td>
            {% if (!i && !o.options.autoUpload) { %}
                <button class="btn btn-primary start" disabled>
                    <i class="glyphicon glyphicon-upload"></i>
                    <span>Start</span>
                </button>
            {% } %}
            {% if (!i) { %}
                <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>Cancel</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
 /*]]>*/
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
    /*<![CDATA[*/
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        <td>
            <span class="preview">
                {% if (file.thumbnailUrl) { %}
                    <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
                {% } %}
            </span>
        </td>
        <td>
            <p class="name">
                {% if (file.url) { %}
                    <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
                {% } else { %}
                    <span>{%=file.name%}</span>
                {% } %}
            </p>
            {% if (file.error) { %}
                <div><span class="label label-danger">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <span class="size">{%=o.formatFileSize(file.size)%}</span>
        </td>
        <td>
            {% if (file.deleteUrl) { %}
                <button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
                    <i class="glyphicon glyphicon-trash"></i>
                    <span>Delete</span>
                </button>
                <input type="checkbox" name="delete" value="1" class="toggle">
            {% } else { %}
                <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>Cancel</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
 /*]]>*/
</script>
</body>
</html>